﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Algorithm4Fun
{
    class Program
    {
        static void Main(string[] args)
        {
            RemoveMultipleSpaces rms = new RemoveMultipleSpaces();
            char[] input = "abc    def".ToCharArray();
             int resultLength = 0;
             Console.WriteLine("input:{0},length:{1}", new String(input, 0, input.Length), resultLength);
             resultLength = rms.Go(input);
             Console.WriteLine("input:{0},length:{1}", new String(input, 0, input.Length), resultLength);

            input = "abc    def       ghi".ToCharArray();
            Console.WriteLine("input:{0},length:{1}", new String(input, 0, input.Length), resultLength);
            resultLength = rms.Go(input);
            Console.WriteLine("input:{0},length:{1}", new String(input, 0, input.Length), resultLength);

            input = " a b   d e ".ToCharArray();
            Console.WriteLine("input:{0},length:{1}", new String(input, 0, input.Length), resultLength);
            resultLength = rms.Go(input);
            Console.WriteLine("input:{0},length:{1}", new String(input, 0, input.Length), resultLength);

            input = "             ".ToCharArray();
            Console.WriteLine("input:{0},length:{1}", new String(input, 0, input.Length), resultLength);
            resultLength = rms.Go(input);
            Console.WriteLine("input:{0},length:{1}", new String(input, 0, input.Length), resultLength);

        }
    }
}
